package com.yuhanginfo.modules.web.entity;

import com.fasterxml.jackson.annotation.JsonBackReference;
import org.hibernate.validator.constraints.Length;

import com.yuhanginfo.common.persistence.WebDataEntity;

/**
 * 物料管理Entity
 * @author yangs
 * @version 2017-09-27
 */
public class WebClasses extends WebDataEntity<WebClasses> {
	
	private static final long serialVersionUID = 1L;
	private WebClasses parent;		// 父id
	private String parentIds;		// 所有父id
	private String name;		// 类目名
	private Integer sort;		// 排序
	private String code;
	
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public WebClasses() {
		super();
	}

	public WebClasses(String id){
		super(id);
	}

	@JsonBackReference
	public WebClasses getParent() {
		return parent;
	}

	public void setParent(WebClasses parent) {
		this.parent = parent;
	}
	
	@Length(min=0, max=50, message="所有父id长度必须介于 0 和 50 之间")
	public String getParentIds() {
		return parentIds;
	}

	public void setParentIds(String parentIds) {
		this.parentIds = parentIds;
	}
	
	@Length(min=0, max=50, message="类目名长度必须介于 0 和 50 之间")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public Integer getSort() {
		return sort;
	}

	public void setSort(Integer sort) {
		this.sort = sort;
	}
	
}